{__NOLAYOUT__}
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>全部课程-{$seo_title}</title>
    <include file="Index:meta" />
    <!-- Swiper -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.4.2/css/swiper.min.css" rel="stylesheet">
</head>

<body>
    <i class="goTop"></i>
    <div id="page">
        <!-- Header -->
        <include file="Index:header" />
        <!-- Header End -->
        <!-- Banner -->
        <section class="banner">
            <div class="tab-inner container">
                <ul class="tab">
                    <!-- <foreach name="data" item="vo"> -->
                    <li>
                        <a href="index.php?m=Index&a=major&pid={$vo.id.val}">{$vo.title.val}</a>
                        <!-- <notempty name="vo.gwlist"> -->
                        <div class="tab-con">
                            <div class="link">
                                <!-- <foreach name="vo.gwlist" item="vg"> -->
                                <div class="tab-con-line clearfix">
                                    <h4><a href="index.php?m=Index&a=major&pid={$vo.id.val}&cid={$vg.id.val}"> {$vg.title.val}</a></h4>
                                    <div>
                                        <!-- <foreach name="vg.xmlist" item="vx"> -->
                                            <a href="index.php?m=Index&a=details&pid={$vo.id.val}&cid={$vg.id.val}&oid={$vx.id.val}"> {$vx.title.val}</a>
                                        <!-- </foreach> -->
                                    </div>
                                </div>
                                <!-- </foreach> -->
                            </div>
                        </div>
                        <!-- </notempty> -->
                    </li>
                    <!-- </foreach> -->
                </ul>
            </div>
            <!-- Swiper -->
            <div class="swiper-container">
                <div class="swiper-wrapper">
                    <!-- <foreach name="hdp" item="vo"> -->
                    <div class="swiper-slide" style="background-image:url(http://hgedu.fjhgkj.com{$vo.pic})">
                        <a href="{$vo.link}" title="{$vo.title}"></a>
                    </div>
                    <!-- </foreach> -->
                </div>
                <!-- Add Pagination -->
                <div class="swiper-pagination"></div>
            </div>
        </section>
        <!-- Banner End -->

        <!-- Subnav -->
        <section class="subnav">
            <switch name="ms">
                <case value="2|3">
            
                    <!-- 老师-->
                    <a href="#op1" class="active">匹配专业</a>
                    <a href="#op2">其他共建专业</a>
                </case>
                <default />
                <a href="#op1" class="active">全部共建专业</a>
            </switch>
        </section>
        <!-- Subnav End -->
        <!-- 专业列表 -->
        <switch name="ms">
            <case value="2|3">
             
                <!-- 老师 -->
                <!-- tab 1 -->
                <div class="box-all" id="op1">
                    <ul class="project list-upstyled">
                        <li class="container">

                            <!--<foreach  name="data" item="vo" key="ko"> -->
                            <if condition="$vo['acctype']['val'] == 'in'">
                                <include file="Index:index_project" />
                            </if>
                            <!-- </foreach> -->
                        </li>
                    </ul>
                </div>
                <!-- tab 2 -->
                <div class="box-m none" id="op2">
                    <!-- 已参与 -->
                    <ul class="project list-upstyled">
                        <li class="container">
                            <div class="project-state">已参与</div>
                            <!--<foreach  name="data" item="vo" key="ko"> -->
                            <if condition="$vo['acctype']['val'] == 'nin'">
                                <include file="Index:index_project" />
                            </if>
                            <!-- </foreach> -->
                        </li>
                    </ul>
                    <!-- 已参与 end-->
                    <!-- 未参与 -->
                    <ul class="project not list-upstyled">
                        <li class="container">
                            <!-- 学校 -->
                            <div class="project-state">未参与</div>
                            <!--<foreach  name="data" item="vo" key="ko"> -->
                            <if condition="$vo['acctype']['val'] == 'all'">
                                <include file="Index:index_project" />
                            </if>
                            <!-- </foreach> -->
                        </li>
                    </ul>
                    <!-- 未参与 end-->
                </div>
                <!-- 老师 end-->
            </case>
            <default />
            <!-- 列表 学校 游客-->
            <div class="box-all" id="op1">
                <ul class="project list-upstyled">
                    <li class="container">
                        <if condition="$ms == '1'">
                            <!-- 已参与 -->
                            <div class="project-state">已参与</div>
                            <!--<foreach  name="data" item="vo" key="ko"> -->
                            <if condition="$vo['acctype']['val'] == 'in'">
                                <include file="Index:index_project" />
                            </if>
                            <!-- </foreach> -->
                            <else />
                            <!-- 默认 -->
                            <!--<foreach  name="data" item="vo" key="ko"> -->
                            <include file="Index:index_project" />
                            <!-- </foreach> -->
                        </if>
                    </li>
                </ul>
                <if condition="$ms == 1">
                    <!-- 未参与 -->
                    <ul class="project not list-upstyled">
                        <li class="container">
                            <!-- 学校 -->
                            <div class="project-state">未参与</div>
                            <!--<foreach  name="data" item="vo" key="ko"> -->
                            <if condition="$vo['acctype']['val'] == 'all'">
                                <include file="Index:index_project" />
                            </if>
                            <!-- </foreach> -->
                        </li>
                    </ul>
                </if>
            </div>
            <!-- 列表 学校 游客 end-->
        </switch>
        <!-- 专业列表 end-->
        <!-- footer  -->
        <include file="Index:footer" />
        <!-- footer end -->
    </div>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.4.2/js/swiper.min.js"></script>
    <script>
        $(function () {
            var menujson = {$menu};//数据
            // server data
            var swiper = new Swiper('.banner .swiper-container', {
                autoplay: 7000, //可选选项，自动滑动
                pagination: '.banner .swiper-pagination',
                paginationClickable: true,
            })

            //tab zy
            $(".subnav a").on("click", function (e) {
                e.preventDefault();
                var id = $(this).attr("href");
                if (id) {
                    $(this).addClass("active").siblings("a").removeClass("active");
                    $(id).removeClass("none").siblings(".box-all,.box-m").addClass("none");
                }
                // 初始化懒加载
                srcollLoadImg(function ($obj) {
                    var $img = $obj;
                    //比例
                    var h = $img.width() / (280/160) + "px";
                    $img.height(h);
                });
            })

            //切换岗位
            $(".project-class a").on("click", gwDom);

            $(".project-class a.active").trigger("click");
            // 初始化懒加载
            srcollLoadImg(function ($obj) {
                var $img = $obj;
                //比例
                var h = $img.width() / (280/160) + "px";
                $img.height(h);
            });
            //岗位 dom
            function gwDom() {
                var $this = $(this);
                //项目数据
                var zy = menujson[$this.data("zy")];
                //岗位数据
                var gw = zy.gwlist[$this.data("gw")];
                //    项目列表
                var data = gw.xmlist;
               
                //生成项目dom
                var dom = "";
                for (var i = 0; i < data.length; i++) {
                    var pro = data[i];
                    dom += projectDom(pro, zy.id.val, gw.id.val, i + 1);
                }
                //active
                $this.addClass("active").siblings("a").removeClass("active");
                //同级的下一个为内容模块
                $this.parents(".project-class").next(".card-group").html(dom);
                // $('[href="javascript:;"]').modalTrigger({icon: 'heart'});

                // 初始化懒加载
                srcollLoadImg(function ($obj) {
                    var $img = $obj;
                    //比例
                    var h = $img.width() / (280/160) + "px";
                    $img.height(h);
                });
            }

            /**
            *project dom
            *@param {Object} d 项目数据
            *@param {number} p 专业id
            *@param {number} c 岗位id 
            *@param {number} i 序号 
             */
            
            function projectDom(d, p, c, i) {
                //项目链接
                var href = "index.php?m=Index&a=details&pid=" + p + "&cid=" + c + "&oid=" + d.id.val + "\"" ;

                return "<div class=\"card-box\">"
                    + "  <div class=\"card-box-content\">"
                    + "      <div class=\"card-img mb-20\">"
                    + "          <a href=\"" + href + "\" title=\"" + d.title.val + "\">"
                    + "             <img src=\"__PUBLIC__/dist/image/img.jpg\" data-src=\"http://hgedu.fjhgkj.com" + d.bigimage.val + "\" >"
                    + "         </a>"
                    + "     </div>"
                    + "     <div class=\"card-info\">"
                    + "         <p class=\"text-ellipsis mb-20\">"
                    + "              <a href=\"" + href + "\">" + d.title.val + "</a>"
                    + "          </p>"
                    + "          <p class=\"card-info-item clearfix\">"
                    + "              <label title=\"任务数\">"
                    + "                  <i class=\"icon-rw\"></i>" + empty(d, ['rwsnum', 'val']) + "</label>"
                    + "              <label title=\"微课数\">"
                    + "                  <i class=\"icon-wk\"></i>" + empty(d, ['wkkjnum', 'val']) + "</label>"
                    + "              <label title=\"素材数\">"
                    + "                  <i class=\"icon-sc\"></i>" + empty(d, ['jxscnum', 'val']) + "</label>"
                    + "          </p>"
                    + "      </div>"
                    + "  </div>"
                    + "</div>";
            }

            /**
            *为空处理
            *@param {Object} data 对象
            *@param {Array} keys 键值
            */
            function empty(data, keys) {
                var n = keys.length;
                if (!data || !n) return;

                var i = 0;
                //数据
                while (i < n) {
                    var k = keys[i];
                    if (data[k]) {
                        data = data[k];
                        i++;
                    } else {
                        data = 0;
                        break;
                    }
                }
                return data;
            }

        })
    </script>
</body>

</html>